function clearForm(){
	document.getElementById("name").value = "";
	document.getElementById("email").value = "";
	document.getElementById("subject").value = "";
	document.getElementById("message").value = "";
}

function hoverContact(elem){
	elem.style.opacity = 1;
	elem.style.cursor = "pointer";
}

function unhoverContact(elem){
	elem.style.opacity = .6;
}

function submitForm(elem){

	var name = document.getElementById("name").value;
	var email = document.getElementById("email").value;
	var subject = document.getElementById("subject").value;
	var message = document.getElementById("message").value;

	//Check if all the fields are properly filled out
	if (name == "" || email == "" || subject == "" || message == "")
		alert("Please fill out all of the contact form fields");
	//If everything is filled out, send out the email
	else{
		var type        = "contactEmail";
		var param_names = "type, name, email, subject, message";
		var param_vals  =  type + "," + name + "," + email + "," + subject + "," + message;
		var url         = "request_data.php";

		response = postRequest(param_names, param_vals, url);
		alert("We'll get back with you as soon as possible");

		clearForm();

	}
}

